<?php

//This is the directory where images will be saveds
$target = "uploaded/";

//This gets all the other information from the form
$info = $_FILES['datafile'];
echo print_r($info);
$pic= $_FILES['datafile']['name'];

// following example code allows you to check for type and change file name. We didn't use this code yet.
// foreach($arg_list as $key=>$value) {
	// if(is_array($value) AND is_array($value[0])) {
		// if($value[0]['error'] == 0 AND isset($value[1])) {
			// if($value[0]['size'] > 0 AND $value[0]['size'] < 500000) {
				// $typeAccepted = array("image/jpeg", "image/gif", "image/png");
				// if(in_array($value[0]['type'],$typeAccepted)) {    
					// $destination = $value[1];
					// if(isset($value[2])) {
						// $extension = substr($value[0]['name'] , strrpos($value[0]['name'] , '.') +1);
						// $destination .= (str_replace(" ","-",$value[2])).".".$extension;
					// } else {
						// $destination .= $value[0]['name'];
					// }
					
					// if(move_uploaded_file($value[0]['tmp_name'],$destination)) {
						// $i++;
						// $unlinkElement[] = $destination;
					// }
				// }
			// }
		// }
	// }
// }

// // Connects to your Database
// mysql_connect("yourhost", "username", "password") or die(mysql_error()) ;
// mysql_select_db("dbName") or die(mysql_error()) ;

// //Writes the information to the database
// mysql_query("INSERT INTO tableName (nameMember,bandMember,photo,aboutMember,otherBands)
// VALUES ('$name', '$bandMember', '$pic', '$about', '$bands')") ;

//Writes the photo to the server

// if (move_uploaded_file($_FILES['datafile']['tmp_name'], $target . $_FILES['datafile']['name'])) {
	// echo "uploaded";
// } else {
	// echo "error";
// }
?>